package com.lanou.sinasports.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.lanou.sinasports.fragment.MyTeamFragment;
import com.lanou.sinasports.fragment.SignRankFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by dllo on 16/1/11.
 */
public class TeamAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragments;
    private String titles[]={"我的球队","签到排行"};

    public TeamAdapter(FragmentManager fm) {
        super(fm);
        fragments=new ArrayList<>();
        MyTeamFragment myTeamFragment=new MyTeamFragment();
        SignRankFragment signRankFragment=new SignRankFragment();
        fragments.add(myTeamFragment);
        fragments.add(signRankFragment);
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
